﻿<%@ Page Language="C#" MasterPageFile="~/NestedMasterPageHome.master" %>

<%@ Register Src="~/UserControls/ProductLinkControl.ascx" TagPrefix="ProductLink" TagName="ProductLinkControl" %>
<%@ Register Src="~/UserControls/ProductItemControl.ascx" TagPrefix="ProductLink" TagName="ProductItemControl" %>
<%@ Register Src="~/UserControls/TickerControl.ascx" TagPrefix="ProductLink" TagName="TickerControl" %>
<%@ Register Src="~/UserControls/BannerControl.ascx" TagPrefix="ProductLink" TagName="BannerControl" %>

<script runat="server">
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!Page.IsPostBack)
    {
      try
      {
        //六大區促銷產品
        for (int i = 0; i < 6; i++)
        {
          ProductItemControl ProductItem =
            (ProductItemControl)this.LoadControl("~/UserControls/ProductItemControl.ascx");
          ProductItem.ProductCategory = i.ToString();
          switch (i)
          {
            case 0:
              ProductItem.ProductText = "暢銷排行榜";
              break;
            case 1:
              ProductItem.ProductText = "整點特賣";
              break;
            case 2:
              ProductItem.ProductText = "期間限定";
              break;
            case 3:
              ProductItem.ProductText = "站長推薦";
              break;
            case 4:
              ProductItem.ProductText = "會員獨享";
              break;
            case 5:
              ProductItem.ProductText = "點擊排行榜";
              break;
          }
          HomeList.Controls.Add(ProductItem);
        }
      }
      catch (Exception ex)
      {
        throw ex;
      }
    }
  }
</script>


<asp:Content ID="nested" ContentPlaceHolderID="NestedContent" runat="server">
  <ProductLink:BannerControl runat="server" ID="BannerControl" />
  <ProductLink:TickerControl runat="server" id="TickerControl" />
  <asp:Panel ID="HomeList" runat="server" class="home-list"/>
  <div class="new-products-nav-home">
    <h4>各館新品</h4>    
    <ul>
      <li>
        <asp:HyperLink ID="n1" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsList.aspx?NewCatID=6"></asp:HyperLink></li>
      <li>
        <asp:HyperLink ID="n2" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsList.aspx?NewCatID=7"></asp:HyperLink></li>
      <li>
        <asp:HyperLink ID="n3" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsList.aspx?NewCatID=8"></asp:HyperLink></li>
      <li>
        <asp:HyperLink ID="n4" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsList.aspx?NewCatID=9"></asp:HyperLink></li>
      <li>
        <asp:HyperLink ID="n5" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsList.aspx?NewCatID=10"></asp:HyperLink></li>
      <li>
        <asp:HyperLink ID="n6" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsList.aspx?NewCatID=11"></asp:HyperLink></li>
      <li>
        <asp:HyperLink ID="n7" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsListMileages.aspx?NewCatID=12"></asp:HyperLink></li>
      <li>
        <asp:HyperLink ID="n8" ClientIDMode="Static" runat="server" NavigateUrl="~/Products/ProductsList.aspx?NewCatID=13"></asp:HyperLink></li>
    </ul>
  </div>
</asp:Content>
